Skip to content

add mixed timeline when new account added#1171

Merged
Tlaster merged 1 commit intomasterfrom
feature/auto_mixed_timeline
Aug 14, 2025
Merged

add mixed timeline when new account added#1171
Tlaster merged 1 commit intomasterfrom
feature/auto_mixed_timeline

Conversation

@Tlaster
Copy link
Copy Markdown
Contributor

@Tlaster Tlaster commented Aug 13, 2025

No description provided.

@Tlaster Tlaster requested a review from Copilot August 13, 2025 09:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Implements automatic creation of home timeline tabs when new accounts are added to the application. The change enables mixed timeline by default and automatically adds timeline tabs for newly added accounts.

Key changes:

  • Adds account event tracking through new presenter to monitor account additions/removals
  • Enables mixed timeline by default and empties default main tabs
  • Automatically creates timeline tabs when accounts are added/removed

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
AccountRepository.kt Adds event flows to track account additions and removals
AccountEventPresenter.kt New presenter to expose account addition/removal events to UI
HomeTimelineScreen.kt Implements automatic tab creation/removal based on account events
TabSettings.kt Enables mixed timeline by default and adds constructor for account-specific tabs
TimelinePresenter.kt Changes first() to firstOrNull() to handle missing accounts gracefully
AdaptiveCard.kt Changes card elevation styling

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

}
val onRemoved: Flow<MicroBlogKey> by lazy {
_onRemoved
.mapNotNull { it }
Copy link

Copilot AI Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using MutableStateFlow for events can cause issues as new subscribers will not receive previously emitted events. Consider using SharedFlow or Channel for proper event emission semantics.

Suggested change
.mapNotNull { it }
MutableSharedFlow<UiAccount>(extraBufferCapacity = 1)
}
val onAdded: Flow<UiAccount> by lazy {
_onAdded
.distinctUntilChangedBy { it.accountKey }
}
private val _onRemoved by lazy {
MutableSharedFlow<MicroBlogKey>(extraBufferCapacity = 1)
}
val onRemoved: Flow<MicroBlogKey> by lazy {
_onRemoved

Copilot uses AI. Check for mistakes.
}
val onRemoved: Flow<MicroBlogKey> by lazy {
_onRemoved
.mapNotNull { it }
Copy link

Copilot AI Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using MutableStateFlow for events can cause issues as new subscribers will not receive previously emitted events. Consider using SharedFlow or Channel for proper event emission semantics.

Suggested change
.mapNotNull { it }
MutableSharedFlow<UiAccount>(replay = 0)
}
val onAdded: Flow<UiAccount> by lazy {
_onAdded
.distinctUntilChangedBy { it.accountKey }
}
private val _onRemoved by lazy {
MutableSharedFlow<MicroBlogKey>(replay = 0)
}
val onRemoved: Flow<MicroBlogKey> by lazy {
_onRemoved

Copilot uses AI. Check for mistakes.
val tab =
HomeTimelineTabItem(
accountKey = account.accountKey,
icon = UiRssSource.favIconUrl(account.accountKey.host),
Copy link

Copilot AI Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using UiRssSource.favIconUrl for account icons seems semantically incorrect. Consider creating a dedicated method for account favicon URLs or using a more appropriate API.

Suggested change
icon = UiRssSource.favIconUrl(account.accountKey.host),
icon = accountFaviconUrl(account.accountKey.host),

Copilot uses AI. Check for mistakes.
@Tlaster Tlaster merged commit 7dd7248 into master Aug 14, 2025
5 checks passed
@Tlaster Tlaster deleted the feature/auto_mixed_timeline branch August 14, 2025 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants